<div class="panel panel-info">
	<div class="panel-heading height-53">
		<label class="font-160">{{recipientRelation.recipient | formatPerson}}</label>
	</div>
	<div class="panel-body">
		<message-error-panel ng-model="message" auto-close="true"></message-error-panel>
		<div class="bot-10">
			<button type="button" class="btn btn-warning btn-sm" ng-if="config.editable" ng-click="add()"><span class="glyphicon glyphicon-plus-sign"></span></button>
			<button type="button" class="btn btn-warning btn-sm" ng-if="config.generateLetter" ng-click="letter()"><span class="glyphicon glyphicon-file"></span></button>
		</div>
		<table class="table table-striped">
			<thead>
				<tr>
					<th>#</th>
					<th>{{'Payment.effectiveDate' | translate}}</th>
					<th>{{'Payment.paymentDate' | translate}}</th>
					<th>{{'Payment.amount' | translate}}</th>
					<th>{{'Payment.type' | translate}}</th>
					<th>{{'Payment.state' | translate}}</th>
					<th>{{'options' | translate}}</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="payment in payments">
					<td>{{$index+1}}</td>
					<td>{{payment.effectiveDate | date : 'dd/MM/yyyy'}}</td>
					<td>{{payment.paymentDate | date : 'dd/MM/yyyy'}}</td>
					<td>{{payment.amount | amount}}</td>
					<td>{{'PaymentWarrantyType.' + payment.type | translate}}</td>
					<td><label class="label" ng-class="{'label-success' : payment.state == 'PAYED', 'label-warning' : payment.state == 'PENDING', 'label-danger' : payment.state == 'REJECTED'}">{{'PaymentState.' + payment.state | translate}}<label></td>
					<td class="vert-align">
						<button type="button" ng-if="config.editable" class="btn btn-warning btn-sm" ng-click="edit(payment)"><span class="glyphicon glyphicon-edit"></span></button>
						<button type="button" ng-if="config.editable" ng-hide="{{payment.state != 'PENDING'}}" class="btn btn-success btn-sm" ng-click="approve(payment)"><span class="glyphicon glyphicon-ok-circle"></span></button>
						<button type="button" ng-if="config.editable" ng-hide="{{payment.state != 'PENDING'}}" class="btn btn-danger btn-sm" ng-click="reject(payment)"><span class="glyphicon glyphicon-remove-circle"></span></button>
					</td>
				</tr>
			</tbody>
		</table>
	</div>